#include "lom-events.hh"

using namespace licada;


namespace lom
{
    EventSender::EventSender() : eventSystem( NULL )
    {
    }
    
    EventSender::~EventSender()
    {
    }
    
    void EventSender::setEventHandler( ILomEventHandler* evt ) const { eventSystem = evt; }
    
    ILomEventHandler* EventSender::getEventHandler() const { return eventSystem; }
	
    //Simply forwards the calls to child systems
    void EventSender::sendClassCreated( const LomClass& cls )
    {
	if ( eventSystem) eventSystem->classCreated( cls );
    }
    void EventSender::sendInstanceCreated( THandle instance )
    {
	if ( eventSystem ) eventSystem->instanceCreated( instance );
    }
    void EventSender::sendInstanceDestroyed( THandle instance )
    {
	if ( eventSystem ) eventSystem->instanceDestroyed( instance );
    }
    void EventSender::sendPropertyEvent( THandle instance, licada::uint32 propName
					 , const LomValue& finalValue )
    {
	if ( eventSystem ) eventSystem->propertyEvent( instance, propName, finalValue );
    }

}
